package com.ruoyi.service.impl;

import com.ruoyi.domain.UserData;
import com.ruoyi.dto.BasisLoadingPositionEquipmentUser;
import com.ruoyi.dto.BasisPositionFrequencyConverterUser;
import com.ruoyi.dto.BasisPositionReceiverUser;
import com.ruoyi.dto.BasisPositionResourceInfoUser;
import com.ruoyi.mapper.UserDataMapper;
import com.ruoyi.service.IUserDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class UserDataServiceImpl implements IUserDataService {

    @Autowired
    UserDataMapper userDataMapper;
    @Override
    public boolean addBasisPositionUser(UserData userData) {
        return userDataMapper.addBasisPositionUser(userData);
    }

    @Override
    public boolean addBasisLoadingPositionEquipmentUser(BasisLoadingPositionEquipmentUser basisLoadingPositionEquipmentUser) {
        return userDataMapper.addBasisLoadingPositionEquipmentUser(basisLoadingPositionEquipmentUser);
    }

    @Override
    public boolean addBasisLoadingPositionResourcesUser(BasisPositionResourceInfoUser basisPositionResourceInfoUser) {
        return userDataMapper.addBasisLoadingPositionResourcesUser(basisPositionResourceInfoUser);
    }

    @Override
    public boolean addBasisPositionFrequencyConverterUser(BasisPositionFrequencyConverterUser basisPositionFrequencyConverterUser) {
        return userDataMapper.addBasisPositionFrequencyConverterUser(basisPositionFrequencyConverterUser);
    }

    @Override
    public boolean addBasisPositionReceiverUser(BasisPositionReceiverUser basisPositionReceiverUser) {
        return userDataMapper.addBasisPositionReceiverUser(basisPositionReceiverUser);
    }

    @Override
    public List<UserData> findByPositionId(Long positionId, String loadingId) {
        return userDataMapper.findByPositionId(positionId, loadingId);
    }

    @Override
    public List<UserData> findByLoadingIdFormUser(String loadingId) {
        return userDataMapper.findByLoadingIdFormUser(loadingId);
    }

    @Override
    public List<UserData> findByLoadingIdFormUserResource(String loadingId) {
        return userDataMapper.findByLoadingIdFormUserResource(loadingId);
    }

    @Override
    public List<UserData> findByLoadingIdAndUserIdFormUserResource(String loadingId, Long userId) {
        return userDataMapper.findByLoadingIdAndUserIdFormUserResource(loadingId, userId);
    }

    @Override
    public List<UserData> findByBasisPositionEquipmentUser(String loadingId, Long positionId, Long equipmentId) {
        return userDataMapper.findByBasisPositionEquipmentUser(loadingId, positionId, equipmentId);
    }

    @Override
    public  List<Map<String,Object>> findByBasisPositionUserEq(String loadingId, Long positionId) {
        return userDataMapper.findByBasisPositionUserEq(loadingId, positionId);
    }

    @Override
    public List<Map<String, Object>> findByBasisPositionUserResource(String loadingId, Long positionId) {
        return userDataMapper.findByBasisPositionUserResource(loadingId, positionId);
    }

    @Override
    public boolean delbasisPositionEquipmentUser(String loadingId, Integer positionId, Integer eqId) {
        return userDataMapper.delbasisPositionEquipmentUserEqid(loadingId, positionId, eqId);
    }

    @Override
    public boolean delBasisPositionUser(String loadingId, Integer positionId, Integer userId) {
        return userDataMapper.delBasisPositionUser(loadingId, positionId, userId);
    }

    @Override
    public boolean delBasispositionEquipmentUser(String loadingId, Integer positionId, Integer userId) {
        return userDataMapper.delBasispositionEquipmentUser(loadingId, positionId, userId);
    }

    @Override
    public boolean delBasisPositionUser2(String loadingId, Integer positionId) {
        return userDataMapper.delBasisPositionUser2(loadingId, positionId);
    }
}
